//---------------------------------------------------------------------------


#pragma hdrstop
#include <vcl.h>

#include "utils.h"
#include "Unit2.h"
#include "Unit1.h"
#include <math.h>

//---------------------------------------------------------------------------
void Delay(DWORD DT)
{
  long tt;
  tt = GetTickCount();
  while (GetTickCount() - tt < DT * 2)
  {
    Application->ProcessMessages();
    if((GetTickCount() - tt) <= 0)
      tt = GetTickCount();
    Sleep(1);
  }
}

//---------------------------------------------------------------------------
void ShowNow(void)
{
/*
     SYSTEMTIME   systemTime;
     AnsiString   showtime;

    GetLocalTime(&systemTime);
    showtime= systemTime.wSecond;
    ShowMessage(showtime);
    return showtime;
*/

  TDateTime dt = Now();
  AnsiString st = dt.FormatString("YYYYY-MM-DD   HH:NN:SS ");
//ShowMessage(st);

  Form2->RichEdit1->Lines->Add(st);

}

//---------------------------------------------------------------------------
AnsiString ShowDate(void)
{
/*
     SYSTEMTIME   systemTime;
     AnsiString   showtime;

    GetLocalTime(&systemTime);
    showtime= systemTime.wSecond;
    ShowMessage(showtime);
    return showtime;
*/

  TDateTime dt = Now();
  AnsiString date = dt.FormatString("YYYYY-MM-DD");
//ShowMessage(st);

  Form2->RichEdit1->Lines->Add(date);
  return date;
}

//---------------------------------------------------------------------------
AnsiString ShowTime(void)
{
/*
     SYSTEMTIME   systemTime;
     AnsiString   showtime;

    GetLocalTime(&systemTime);
    showtime= systemTime.wSecond;
    ShowMessage(showtime);
    return showtime;
*/

  TDateTime dt = Now();
  AnsiString tt = dt.FormatString("HH:NN:SS");
//ShowMessage(st);

  Form2->RichEdit1->Lines->Add(tt);
  return tt;

}

//---------------------------------------------------------------------------
void ResetStatus(void)
{
  Form1->Shape1->Brush->Color = clWhite;

  Form1->Shape2->Brush->Color = clWhite;

  Form1->Shape3->Brush->Color = clWhite;
  Form1->Shape4->Brush->Color = clWhite;
  Form1->Shape5->Brush->Color = clWhite;

  Form1->Shape6->Brush->Color = clWhite;
  Form1->Shape7->Brush->Color = clWhite;
  Form1->Shape8->Brush->Color = clWhite;

  Form1->Shape9->Brush->Color = clWhite;
  Form1->Shape10->Brush->Color = clWhite;
  Form1->Shape11->Brush->Color = clWhite;

  Form1->Shape10->Brush->Color = clWhite;
  Form1->Shape13->Brush->Color = clWhite;
  Form1->Shape14->Brush->Color = clWhite;

  Form1->Shape15->Brush->Color = clWhite;
  Form1->Shape16->Brush->Color = clWhite;
  Form1->Shape17->Brush->Color = clWhite;

  Form1->Shape18->Brush->Color = clWhite;
  Form1->Shape19->Brush->Color = clWhite;
  Form1->Shape20->Brush->Color = clWhite;

  Form1->Shape21->Brush->Color = clWhite;
  Form1->Shape22->Brush->Color = clWhite;
  Form1->Shape23->Brush->Color = clWhite;

  Form1->Shape24->Brush->Color = clWhite;
  Form1->Shape25->Brush->Color = clWhite;
  Form1->Shape26->Brush->Color = clWhite;


}

#pragma package(smart_init)

